import java.util.*;

public class a1{
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int n=cin.nextInt();
        solve(n);
    }
    public static void print(int l,int r){
        for(int i=l;i<=r;i++){
            System.out.print(i+" ");
        }
        System.out.println();
    }
    public static void solve(int n){
        if(n<3){
            return;
        }
        int l=1,r=2;
        int m=(1+n)/2;
        int cur=l+r;
        while(l<r){
            
            //System.out.println(l+" "+r+" "+cur);
            if(cur==n){
                print(l,r);
            }
            while(cur>n&&l<m){
                cur-=l;
                l++;
                if(cur==n){
                    print(l,r);
                }
            }
            r++;
            cur+=r;
        }
    }


} 